home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_aet_enddilator.cog < prev    next >
Text File  |  1999-11-15  |  13KB  |  465 lines

  1. # Jones 3D Cog Script
  2. #
  3. # aet_EndDialator.cog
  4. #
  5. # [TL & revised by HB]
  6. #
  7. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  8. # ==============================================================================
  9. symbols
  10.     
  11. message     startup
  12. ## message        activated #### REMOVE BEFORE FLIGHT!
  13. message     damaged
  14. message     pulse
  15. message        user0
  16.  
  17. # Dilation section.
  18. # ------------------------------------------------------------------------------
  19. surface     mem0                                mask=0x8    # No move adjoins
  20. surface     mem1                                mask=0x8
  21. surface     mem2                                mask=0x8
  22.  
  23. thing        player                                local
  24. thing        mem3do0                                        # Single poly 3do membranes
  25. thing        mem3do1
  26. thing        mem3do2
  27.  
  28. sound        fade=aet_por_open.wav                local
  29.  
  30. int            done0=0                                local    # Flag to set when done and opened
  31. int            done1=0                                local
  32. int            done2=0                                local
  33. int            sender                                local
  34.  
  35. # Reality Leak section.
  36. # ------------------------------------------------------------------------------
  37. # Green door things...
  38. thing        babfloorA0                            nolink    # Single poly floor 3dos for reality leak
  39. thing        babfloorA1                            nolink
  40. thing        babfloorA2                            nolink
  41. thing        babfloorA3                            nolink                    
  42. thing        babfloorA4                            nolink
  43. thing        babfloorA5                            nolink
  44. thing        babfloorA6                            nolink                                    
  45. thing        babfloorA7                            nolink
  46. thing        babfloorA8                            nolink
  47. thing        babfloorA14                            nolink    # correct!
  48. thing        babfloorA9                            nolink            
  49. thing        babfloorA10                            nolink
  50. thing        babfloorA11                            nolink
  51. thing        babfloorA12                            nolink                    
  52. thing        babfloorA13                            nolink
  53. thing        babfloorA15                         nolink        
  54. thing        babfloorA16                         nolink            
  55. thing        gravdisc_A                             nolink            
  56.                                         
  57. # Blue door things...
  58. thing        babfloorB0                            nolink    # Single poly floor 3dos for reality leak
  59. thing        babfloorB1                            nolink
  60. thing        babfloorB2                            nolink
  61. thing        babfloorB3                            nolink        
  62. thing        babfloorB4                            nolink
  63. thing        babfloorB5                            nolink
  64. thing        babfloorB6                            nolink        
  65. thing        babfloorB7                            nolink
  66. thing        babfloorB8                            nolink
  67. thing        babfloorB14                            nolink
  68. thing        babfloorB9                            nolink        
  69. thing        babfloorB10                            nolink
  70. thing        babfloorB11                            nolink
  71. thing        babfloorB12                            nolink        
  72. thing        babfloorB13                            nolink
  73. thing        babfloorB15                            nolink        
  74. thing        babfloorB16                            nolink                                     
  75. thing        gravdisc_B                            nolink                                     
  76.                                         
  77. # Red door things...
  78. thing        babfloorC0                            nolink    # Single poly floor 3dos for reality leak
  79. thing        babfloorC1                            nolink
  80. thing        babfloorC2                            nolink
  81. thing        babfloorC3                            nolink        
  82. thing        babfloorC4                            nolink
  83. thing        babfloorC5                            nolink
  84. thing        babfloorC6                            nolink        
  85. thing        babfloorC7                            nolink
  86. thing        babfloorC8                            nolink
  87. thing        babfloorC14                            nolink
  88. thing        babfloorC9                            nolink        
  89. thing        babfloorC10                            nolink
  90. thing        babfloorC11                            nolink
  91. thing        babfloorC12                            nolink        
  92. thing        babfloorC13                            nolink
  93. thing        babfloorC15                            nolink            
  94. thing        babfloorC16                         nolink                                                
  95. thing        gravdisc_C                             nolink                                                
  96.               
  97. thing        por                                            # Last POR ball that must be hid
  98.  
  99. sector        aetsecA0                                    # Aetherium sectors to turn off
  100. sector        aetsecA1
  101. sector        aetsecA2
  102. sector        aetsecA3
  103. sector        aetsecA4
  104.  
  105. sector        aetsecB0
  106. sector        aetsecB1
  107. sector        aetsecB2
  108. sector        aetsecB3
  109. sector        aetsecB4
  110.  
  111. sector        aetsecC0
  112. sector        aetsecC1
  113. sector        aetsecC2
  114. sector        aetsecC3
  115. sector        aetsecC4
  116.  
  117. sector        litSectorA1                                    # Lit sectors
  118. sector        litSectorA2                                    # Lit sectors
  119. sector        litSectorA3                                    # Lit sectors
  120. sector        litSectorB1                                    # Lit sectors
  121. sector        litSectorB2                                    # Lit sectors
  122. sector        litSectorB3                                    # Lit sectors
  123. sector        litSectorC1                                    # Lit sectors
  124. sector        litSectorC2                                    # Lit sectors
  125. sector        litSectorC3                                    # Lit sectors
  126.  
  127. int            countA=0                            local    # Int for counting up for pulse A        
  128. int            countB=0                            local    # Int for counting up for pulse B
  129. int            countC=0                            local    # Int for counting up for pulse C
  130. int            isA=0                                local    # Int for section A pulse
  131. int            isB=0                                local    # Int for section B pulse
  132. int            isC=0                                local    # Int for section C pulse
  133.  
  134. int            countInt=17                            local    # Value of the max number of fade things
  135. flex        pulsetime=0.25                        local    # Value of time for pulse between fades
  136. flex        fadetime=0.20                        local    # Value of time for things to fade
  137.                                                         # *must be less than* the pulsetime    
  138. int            sectorDarkA=0                        local    # Done flag for turning off hall lights
  139. int            sectorDarkB=0                        local    # Done flag for turning off hall lights
  140. int            sectorDarkC=0                        local    # Done flag for turning off hall lights
  141. int            index                                local
  142.  
  143. # Tube fade section.
  144. # ------------------------------------------------------------------------------
  145. thing        tube0
  146. thing        tube1
  147. thing        tube2
  148. thing        tube3
  149. thing        tube4
  150. thing        tube5
  151.  
  152. thing        rubbleB0
  153. thing        rubbleB1
  154. thing        rubbleB2
  155.  
  156. thing        rubbleA0
  157. thing        rubbleA1
  158.  
  159. # End escape section.
  160. # ------------------------------------------------------------------------------
  161. cog            rotatecog                                    # My cog for Mophia cutscene                            
  162. cog            escapeCog                                    # Escape cog go code
  163. cog            hint_cog
  164.  
  165. #### REMOVE BEFORE FLIGHT!
  166.  
  167. int            whichmem=0                            local
  168. int            didmem0=0                            local
  169. int            didmem1=0                            local
  170. int            didmem2=0                            local
  171.  
  172. ####
  173.  
  174. end
  175.  
  176. # ==============================================================================
  177. # ==============================================================================
  178.  
  179. code
  180.  
  181. startup:
  182.  
  183.     player = GetLocalPlayerThing();
  184.  
  185.     ## SetPulse(0.01);
  186.  
  187.     for (index = 0; index < 17; index = index + 1)
  188.     {
  189.         SetThingAlpha(babfloorA0[index], 0.0);
  190.         SetThingAlpha(babfloorB0[index], 0.0);
  191.         SetThingAlpha(babfloorC0[index], 0.0);
  192.         SetCollideType(babfloorA0[index], 0);
  193.         SetCollideType(babfloorB0[index], 0);
  194.         SetCollideType(babfloorC0[index], 0);
  195.     }
  196.     isA = 1;
  197.     isB = 1;
  198.     isC = 1;
  199.  
  200.     SetThingFlags(rubbleA0, 0x80000);
  201.     SetThingFlags(rubbleA1, 0x80000);
  202.     
  203.     SetThingFlags(rubbleB0, 0x80000);
  204.     SetThingFlags(rubbleB1, 0x80000);
  205.     SetThingFlags(rubbleB2, 0x80000);
  206.     
  207.     return;
  208.     
  209. # ..............................................................................
  210.  
  211. #### REMOVE BEFORE FLIGHT!
  212. ## activated:
  213.  
  214.     sender = GetSenderRef();
  215.  
  216.     if (GetSourceRef() != player)
  217.     {
  218.         return;
  219.     }
  220.  
  221.     if ((sender == mem0) && (didmem0 == 0))
  222.     {
  223.         whichmem = 0;
  224.         didmem0 = 1;
  225.         goto damaged;
  226.     }
  227.  
  228.     if ((sender == mem1) && (didmem1 == 0))
  229.     {
  230.         whichmem = 1;
  231.         didmem1 = 1;
  232.         goto damaged;
  233.     }
  234.  
  235.     if ((sender == mem2) && (didmem2 == 0))
  236.     {
  237.         whichmem = 2;
  238.         didmem2 = 1;
  239.         goto damaged;
  240.     }
  241.  
  242.     return;
  243. ####
  244.  
  245. # ..............................................................................
  246.  
  247. damaged:
  248.  
  249. # Dilation section of the three BAB P.O.R.s.
  250. # ------------------------------------------------------------------------------
  251.  
  252.     if ((GetParam(1) == 0x5000) && (done0 == 0) && (GetSenderRef() == mem0))
  253.     #### if (whichmem == 0)
  254.     {
  255.         done0 = 1;
  256.         isA = 2;
  257.         SendMessageEx(rotatecog, user1, 1, 0, 0, 0);
  258.         SendMessage(hint_cog, user3);
  259.         PlaySoundLocal(fade, 1.0, 0, 0x0000, 0);
  260.         ThingFadeAnim(mem3do0, 1, 0, 3.0, 0);
  261.         Sleep(3.0);
  262.         DestroyThing(mem3do0);
  263.         SetAdjoinFlags(mem0, 2);
  264.         # Fade in floor things one at a time for one section.
  265.         SetPulse(pulsetime);
  266.     }
  267.     if ((GetParam(1) == 0x5000) && (done1 == 0) && (GetSenderRef() == mem1))
  268.     #### if (whichmem == 1)
  269.     {
  270.         done1 = 1;
  271.         isB = 2;
  272.         SendMessageEx(rotatecog, user1, 0, 1, 0, 0);
  273.         SendMessage(hint_cog, user4);
  274.         PlaySoundLocal(fade, 1.0, 0, 0x0000, 0);
  275.         ThingFadeAnim(mem3do1, 1, 0, 3.0, 0);
  276.         Sleep(3.0);
  277.         DestroyThing(mem3do1);
  278.         SetAdjoinFlags(mem1, 2);
  279.         # Fade in floor things one at a time for one section.
  280.         SetPulse(pulsetime);
  281.     }
  282.     if ((GetParam(1) == 0x5000) && (done2 == 0) && (GetSenderRef() == mem2))
  283.     #### if (whichmem == 2)
  284.     {
  285.         done2 = 1;
  286.         isC = 2;
  287.         SendMessageEx(rotatecog, user1, 0, 0, 1, 0);
  288.         SendMessage(hint_cog, user5);
  289.         PlaySoundLocal(fade, 1.0, 0, 0x0000, 0);
  290.         ThingFadeAnim(mem3do2, 1, 0, 3.0, 0);
  291.         Sleep(3.0);
  292.         DestroyThing(mem3do2);
  293.         SetAdjoinFlags(mem2, 2);
  294.         # Fade in floor things one at a time for one section.
  295.         SetPulse(pulsetime);
  296.     }
  297.         
  298.     return;
  299.  
  300. # ..............................................................................
  301.  
  302. pulse:
  303.  
  304.     if (isA == 2)
  305.     {
  306.         if (countA == countInt) 
  307.         {
  308.             # Stop fadeing things...
  309.             SetPulse(0);
  310.             isA = 3;
  311.             SendMessage(rotatecog, user3); # done here
  312.  
  313.             if ((isA == 3) && (isB == 3) && (isC == 3))
  314.             {
  315.                 //SendMessage(rotatecog, user2);
  316.             }
  317.             return;
  318.         }
  319.         # Fade things in code...
  320.         # Fade out gravdisc A.
  321.         if (countA == 11)
  322.             {
  323.             ThingFadeAnim(gravdisc_a, 1.0, 0.0, 3.0, 0);
  324.             }
  325.         # Code for single poly floors amd stages...
  326.         ThingFadeAnim(babfloorA0[countA], 0.0, 1.0, fadetime, 0);
  327.         SetThingLight(babfloorA0[countA], '0.5 0.5 0.5', 0.001, fadetime);
  328.         SetCollideType(babfloorA0[countA], 3);
  329.         countA = countA + 1;
  330.         # Code for turning off sector light in hall...
  331.         if (sectorDarkA == 0)
  332.         {
  333.             sectorDarkA = 1;
  334.             SetSectorLight(litSectorA1, '0 0 0', fadetime);
  335.             SetSectorLight(litSectorA2, '0 0 0', fadetime);
  336.             SetSectorLight(litSectorA3, '0 0 0', fadetime);
  337.         }
  338.         return;
  339.     }
  340.  
  341.     if (isB == 2)
  342.     {
  343.         if (countB == countInt) 
  344.         {
  345.             # Stop fadeing things...
  346.             SetPulse(0);
  347.             isB = 3;
  348.             SendMessage(rotatecog, user3); # done here
  349.             if ((isA == 3) && (isB == 3) && (isC == 3))
  350.             {
  351.                 //SendMessage(rotatecog, user2);
  352.             }
  353.             return;
  354.         }
  355.         # Fade things in code...
  356.         # Fade out gravdisc B.
  357.         if (countB == 11)
  358.             {
  359.             ThingFadeAnim(gravdisc_b, 1.0, 0.0, 3.0, 0);
  360.             }
  361.         # Code for single poly floors amd stages...
  362.         ThingFadeAnim(babfloorB0[countB], 0.0, 1.0, fadetime, 0);
  363.         SetThingLight(babfloorB0[countB], '0.5 0.5 0.5', 0.001, fadetime);
  364.         SetCollideType(babfloorB0[countB], 3);
  365.         countB = countB + 1;                      
  366.         # Code for turning off sector light in hall.
  367.         if (sectorDarkB == 0)
  368.         {
  369.             sectorDarkB = 1;
  370.             SetSectorLight(litSectorB1, '0 0 0', fadetime);
  371.             SetSectorLight(litSectorB2, '0 0 0', fadetime);
  372.             SetSectorLight(litSectorB3, '0 0 0', fadetime);
  373.         }
  374.         return;
  375.     }
  376.  
  377.     if (isC == 2)
  378.     {
  379.         if (countC == countInt) 
  380.         {
  381.             # Stop fadeing things...
  382.             SetPulse(0);
  383.             isC = 3;
  384.             SendMessage(rotatecog, user3); # done here
  385.             if ((isA == 3) && (isB == 3) && (isC == 3))
  386.             {
  387.                 //SendMessage(rotatecog, user2);
  388.             }
  389.             return;
  390.         }
  391.         # Fade things in code...
  392.         # Fade out gravdisc C.
  393.         if (countC == 11)
  394.             {
  395.             ThingFadeAnim(gravdisc_c, 1.0, 0.0, 3.0, 0);
  396.             }
  397.         # Code for single poly floors amd stages...
  398.         ThingFadeAnim(babfloorC0[countC], 0.0, 1.0, fadetime, 0);
  399.         SetThingLight(babfloorC0[countC], '0.5 0.5 0.5', 0.001, fadetime);
  400.         SetCollideType(babfloorC0[countC], 3);
  401.         countC = countC + 1;                      
  402.         # Code for turning off sector light in hall...
  403.         if (sectorDarkC == 0)
  404.         {
  405.             sectorDarkC = 1;
  406.             SetSectorLight(litSectorC1, '0 0 0', fadetime);
  407.             SetSectorLight(litSectorC2, '0 0 0', fadetime);
  408.             SetSectorLight(litSectorC3, '0 0 0', fadetime);
  409.         }
  410.         return;
  411.     }
  412.  
  413.     return;
  414.  
  415. # ..............................................................................
  416.  
  417. user0:
  418.  
  419.     # Code for turning off the Aetherium sectors when the PORs are opened...
  420.     ClearSectorFlags(aetsecA0, 0x0100);
  421.     ClearSectorFlags(aetsecA1, 0x0100);
  422.     ClearSectorFlags(aetsecA2, 0x0100);
  423.     ClearSectorFlags(aetsecA3, 0x0100);
  424.     ClearSectorFlags(aetsecA4, 0x0100);
  425.  
  426.     ClearSectorFlags(aetsecB0, 0x0100);
  427.     ClearSectorFlags(aetsecB1, 0x0100);
  428.     ClearSectorFlags(aetsecB2, 0x0100);
  429.     ClearSectorFlags(aetsecB3, 0x0100);
  430.     ClearSectorFlags(aetsecB4, 0x0100);
  431.  
  432.     ClearSectorFlags(aetsecC0, 0x0100);
  433.     ClearSectorFlags(aetsecC1, 0x0100);
  434.     ClearSectorFlags(aetsecC2, 0x0100);
  435.     ClearSectorFlags(aetsecC3, 0x0100);
  436.     ClearSectorFlags(aetsecC4, 0x0100);
  437.     # Code for turning off 3do Aet tubes.
  438.     ThingFadeAnim(tube0, 0.7, 0, 1.0, 0);
  439.     ThingFadeAnim(tube1, 0.7, 0, 1.0, 0);
  440.     ThingFadeAnim(tube2, 0.7, 0, 1.0, 0);
  441.     ThingFadeAnim(tube3, 0.7, 0, 1.0, 0);
  442.     ThingFadeAnim(tube4, 0.7, 0, 1.0, 0);
  443.     ThingFadeAnim(tube5, 0.7, 0, 1.0, 0);
  444.  
  445.     ClearAdjoinFlags(mem0, 2);
  446.     ClearAdjoinFlags(mem2, 2);
  447.     
  448.     ClearThingFlags(rubbleA0, 0x80000);
  449.     ClearThingFlags(rubbleA1, 0x80000);
  450.  
  451.     ClearThingFlags(rubbleB0, 0x80000);
  452.     ClearThingFlags(rubbleB1, 0x80000);
  453.     ClearThingFlags(rubbleB2, 0x80000);
  454.  
  455.     # Code to hide the last POR ball.
  456.     SetThingFlags(por, 0x80000);
  457.     # Send message to escape cog.
  458.     SendMessage(escapeCog, user0);
  459.     SendMessage(escapeCog, user1);
  460.  
  461.     return;
  462.  
  463. end
  464.  
  465.